package com.edu.chat.web.config;

import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: KQAIA
 * @description:
 * @author: 无恙
 * @create: 2025-02-22 17:27
 **/

@Configuration
public class MilvusConfig {


	@Value("${milvus.url}")
	private String url;

	@Value("${milvus.token}")
	private String token;

	@Bean
	public MilvusClientV2 milvusServiceClient() {
		return new MilvusClientV2(ConnectConfig.builder()
				.uri(url)
				.token(token)
				.secure(false)
				.connectTimeoutMs(5000L)
				.build());

	}


}